package monitormercado.negocio.Tick;

import java.util.Comparator;


public class ComparadorTick {

	public static Comparator<Tick> sigla = new Comparator<Tick>() {
		public int compare(Tick a, Tick b) {
			return  a.getSigla().compareTo(b.getSigla());
		}
	};

	public static Comparator<Tick> data = new Comparator<Tick>() {
		public int compare(Tick a, Tick b) {
			return a.getData().compareTo(b.getData());
			
		}
	};

	public static Comparator<Tick> abertura = new Comparator<Tick>() {
		public int compare(Tick a, Tick b) {
			return new Double(a.getAbertura()).compareTo(new Double(b.getAbertura()));
		}
	};

	public static Comparator<Tick> minimo = new Comparator<Tick>() {
		public int compare(Tick a, Tick b) {
			return new Double(a.getMinimo()).compareTo(new Double(b.getMinimo()));
		}
	};

	public static Comparator<Tick> maximo = new Comparator<Tick>() {
		public int compare(Tick a, Tick b) {
			return new Double(a.getMaximo()).compareTo(new Double(b.getMaximo()));
		}
	};

	public static Comparator<Tick> fechamento = new Comparator<Tick>() {
		public int compare(Tick a, Tick b) {
			return new Double(a.getFechamento()).compareTo(new Double(b.getFechamento()));
			
		}
	};

	public static Comparator<Tick> volume = new Comparator<Tick>() {
		public int compare(Tick a, Tick b) {
			return new Double(a.getVolume()).compareTo(new Double(b.getVolume()));
		}
	};

	public static Comparator<Tick> numeroAcoesAlugadas = new Comparator<Tick>() {
		public int compare(Tick a, Tick b) {
			return new Double(a.getNumeroAcoesAlugadas()).compareTo(new Double(b.getNumeroAcoesAlugadas()));
		}
	};

	public static Comparator<Tick> recursosAlugados = new Comparator<Tick>() {
		public int compare(Tick a, Tick b) {
			return new Double(a.getRecursosAlugados()).compareTo(new Double(b.getRecursosAlugados()));
		}
	};

//	public static Comparator<Tick> ehUltimoDiaUtilDaSemana = new Comparator<Tick>() {
//		public int compare(Tick a, Tick b) {
//			int resultado = 0;
//			if (a.getEhUltimoDiaUtilDaSemana() && !b.getEhUltimoDiaUtilDaSemana()) {
//				resultado = 1;
//			} else if (!a.getEhUltimoDiaUtilDaSemana() && b.getEhUltimoDiaUtilDaSemana()) {
//				resultado = -1;
//			}
//			return resultado;
//		}
//	};
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
